package com.tuanzi.loan.business.entity.receipt.product;

import com.tuanzi.loan.core.entity.AuditEntity;
import com.tuanzi.server.loan_base.constant.LoanReceiptProductStatus;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.persistence.*;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

@Entity
@Data
@Table(name = "LOAN_RECEIPT_PRODUCT_CONDITION")
@EqualsAndHashCode(callSuper = true)
public class ReceiptProductCondition extends AuditEntity {

	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	@Column(name = "PRODUCT_ID")
	private Long productId;

	@Max(Integer.MAX_VALUE)
	@Min(0)
	@Column(name = "MIN_SESAME_POINT")
	private Integer minSesamePoint;

	@Max(Integer.MAX_VALUE)
	@Min(0)
	@Column(name = "MAX_SESAME_POINT")
	private Integer maxSesamePoint;

	@Max(100)
	@Min(0)
	@Column(name = "MIN_AGE")
	private Integer minAge;

	@Max(Integer.MAX_VALUE)
	@Min(0)
	@Column(name = "MAX_AGE")
	private Integer maxAge;

	@Max(Integer.MAX_VALUE)
	@Min(0)
	@Column(name = "MIN_INCOME")
	private Integer minIncome;

	@Max(Integer.MAX_VALUE)
	@Min(0)
	@Column(name = "MAX_INCOME")
	private Integer maxIncome;

	@Max(Integer.MAX_VALUE)
	@Min(0)
	@Column(name = "MIN_PHONE_VERIFIED")
	private Integer minPhoneVerified;

	@Max(Integer.MAX_VALUE)
	@Min(0)
	@Column(name = "MIN_PHONEBOOK_COUNT")
	private Integer minPhonebookCount;

	@Max(Integer.MAX_VALUE)
	@Min(0)
	@Column(name = "LAST_1_MONTH_CALLTIME")
	private Integer last1MonthCalltime;

	@Column(name = "PROVINCE")
	private String province; // 省

	@Column(name = "CITY")
	private String city; //城

	@Max(Integer.MAX_VALUE)
	@Min(0)
	@Column(name = "LAST_1_MONTH_PHONECALL")
	private Integer last1MonthPhonecall;

	@Column(name = "REAL_VERIFIED")
	private Boolean realVerified;

	@Column(name = "NEED_CREDIT_CARD")
	private Boolean needCreditCard;

	@Column(name = "STATUS")
	private LoanReceiptProductStatus status;

}
